package og.example.dao;

import java.util.HashMap;
import java.util.Map;

    public class DataProvider {
        private static Map<String, String> users = new HashMap<>();

        static {
            users.put("caowenjie", "2589632147");
            users.put("user2", "password2");
            // 可以添加更多用户
        }

        public static boolean authenticate(String username, String password) {
            return users.containsKey(username) && users.get(username).equals(password);
        }

        public static boolean register(String username, String password) {
            if (!users.containsKey(username)) {
                users.put(username, password);
                return true;
            }
            return false;
        }
    }

